#define _CRT_SECURE_NO_WARNINGS 1
using namespace std;
#include<iostream>


int& Add(int a, int b)
{
	int c = a + b;
	return c;
}
int main1()
{
	int& ret = Add(1, 2);
	cout << "Add(1, 2) is :" << ret << endl;
	Add(3, 4);
	cout << "Add(1, 2) is :" << ret << endl;
	Add(5, 6);
	cout << "Add(1, 2) is :" << ret << endl;
	return 0;
}

int main2() {
	int x = 1;
	int* px = &x;
	int& y = x;
	cout << px << endl;
	cout << y << endl;
	return 0;
}

int& test1(int i) {
	int data = i+1;
	return data;
}

int main3() {
	int& ret = test1(10);
	cout << "result is:" << ret << endl;
	return 0;
}

class Date {
private:
	int _year;
	int _month;
	int _day;

public:
	void Init(int year, int month, int day) {
		_year = year;
		_month = month;
		_day = day;
	}

	void Print() {
		cout << _year << "-" << _month << "-" << _day << endl;
	}

};

int main() {
	Date d1,d2;
	d1.Init(2023, 11, 25);
	d1.Print();
	d2.Init(2024, 11, 25);
	d2.Print();
	return 0;
}